package gitee.derumin.really_forge.items;

import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class RFItems {
    public static final Item COPPER_SWORD = new SwordItem(ExtraToolMaterial.COPPER, 3, -2.4f, new Item.Settings());
    public static final Item COPPER_SHOVEL = new ShovelItem(ExtraToolMaterial.COPPER, 1.5f, -3.0f, new Item.Settings());
    public static final Item COPPER_PICKAXE = new PickaxeItem(ExtraToolMaterial.COPPER, 1, -2.8f, new Item.Settings());
    public static final Item COPPER_AXE = new AxeItem(ExtraToolMaterial.COPPER, 7, -3.2f, new Item.Settings());
    public static final Item COPPER_HOE = new HoeItem(ExtraToolMaterial.COPPER, 3, -3.2f, new Item.Settings());
    public static final Item COPPER_HAMMER = new HammerItem(ExtraToolMaterial.COPPER_FOR_HAMMER,6,-3.5f,new Item.Settings());
    public static final Item WOODEN_HAMMER = new HammerItem(ExtraToolMaterial.WOOD_FOR_HAMMER,1,-2.4f,new Item.Settings());
    public static final Item STONE_HAMMER = new HammerItem(ExtraToolMaterial.STONE_FOR_HAMMER,3,-3f,new Item.Settings());
    public static final Item GOLDEN_HAMMER = new HammerItem(ExtraToolMaterial.GOLD_FOR_HAMMER,7,-3.6f,new Item.Settings());
    public static final Item IRON_HAMMER = new HammerItem(ExtraToolMaterial.IRON_FOR_HAMMER,5,-3.2f,new Item.Settings());
    public static final Item DIAMOND_HAMMER = new HammerItem(ExtraToolMaterial.DIAMOND_FOR_HAMMER,3,-2.8f,new Item.Settings());
    public static final Item NETHERITE_HAMMER = new HammerItem(ExtraToolMaterial.NETHERITE_FOR_HAMMER,5,-3.0f,new Item.Settings());

    public static void init(){
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_sword"), COPPER_SWORD);
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_shovel"), COPPER_SHOVEL);
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_pickaxe"), COPPER_PICKAXE);
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_axe"), COPPER_AXE);
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_hoe"), COPPER_HOE);
        Registry.register(Registries.ITEM, new Identifier("really_forge","copper_hammer"), COPPER_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","wooden_hammer"), WOODEN_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","stone_hammer"), STONE_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","golden_hammer"), GOLDEN_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","iron_hammer"), IRON_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","diamond_hammer"), DIAMOND_HAMMER);
        Registry.register(Registries.ITEM, new Identifier("really_forge","netherite_hammer"), NETHERITE_HAMMER);
        ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(
                content -> {
                    content.addAfter(Items.WOODEN_HOE,WOODEN_HAMMER);
                    content.addAfter(Items.STONE_HOE,STONE_HAMMER);
                    content.addAfter(Items.GOLDEN_HOE,GOLDEN_HAMMER);
                    content.addAfter(Items.IRON_HOE,IRON_HAMMER);
                    content.addAfter(Items.DIAMOND_HOE,DIAMOND_HAMMER);
                    content.addAfter(Items.NETHERITE_HOE,NETHERITE_HAMMER);
                    content.addAfter(IRON_HAMMER,COPPER_SHOVEL);
                    content.addAfter(COPPER_SHOVEL,COPPER_PICKAXE);
                    content.addAfter(COPPER_PICKAXE,COPPER_AXE);
                    content.addAfter(COPPER_AXE,COPPER_HOE);
                    content.addAfter(COPPER_HOE,COPPER_HAMMER);
                }
        );
        ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(
                content -> {
                    content.addAfter(Items.IRON_SWORD,COPPER_SWORD);
                    content.addAfter(Items.IRON_AXE,COPPER_AXE);
                }
        );
    }
}
